| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm'; |
||
| 3 | |||
| 4 | @Entity() |
||
| 5 | export class QuoteItem { |
||
| 6 | @PrimaryGeneratedColumn('uuid') |
||
| 7 | private id: string; |
||
| 8 | |||
| 9 | @Column({type: 'varchar', nullable: false}) |
||
| 10 | private title: string; |
||
| 11 | |||
| 12 | @Column({type: 'integer', nullable: false}) |
||
| 13 | private quantity: number; |
||
| 14 | |||
| 15 | @Column({type: 'integer', nullable: false}) |
||
| 16 | private dailyRate: number; |
||
| 17 | |||
| 18 | @ManyToOne( |
||
| 19 | type => Quote, |
||
| 20 | quote => quote.items, |
||
| 21 | {nullable: false} |
||
| 22 | ) |
||
| 23 | quote: Quote; |
||
| 24 | |||
| 25 | constructor( |
||
| 26 | title: string, |
||
| 27 | quantity: number, |
||
| 28 | dailyRate: number, |
||
| 29 | quote: Quote |
||
| 30 | ) { |
||
| 31 | this.title = title; |
||
| 32 | this.quantity = quantity; |
||
| 33 | this.dailyRate = dailyRate; |
||
| 34 | this.quote = quote; |
||
| 35 | } |
||
| 36 | |||
| 37 | public getTitle(): string { |
||
| 38 | return this.title; |
||
| 39 | } |
||
| 40 | |||
| 41 | public getDailyRate(): number { |
||
| 42 | return this.dailyRate; |
||
| 43 | } |
||
| 44 | |||
| 45 | public getQuantity(): number { |
||
| 46 | return this.quantity; |
||
| 47 | } |
||
| 49 |